const fs = require('fs')


module.exports = (app) => {
  fs.readdirSync(__dirname).forEach(file => {
    //console.log('file:', file)
    if (file === 'index.js') { return; }
    fs.readdirSync(__dirname + "/" + file).forEach(r => {
      const route = require(`./${file}/${r}`)
      app.use(route.routes()).use(route.allowedMethods())
    })

  });
}
